import request from '@/utils/request'

// 获取指标类型下拉列表
export function getKpiTypeList() {
  return request({
    url: '/operation/web/operationGroupDashboard/kpiTypeList',
    method: 'get'
  })
}

// 获取水厂下拉列表
export function getFactoryList() {
  return request({
    url: '/operation/web/operationGroupDashboard/factoryList',
    method: 'get'
  })
}

// 查询集团驾驶舱配置列表
export function getDashboardConfigList(params) {
  return request({
    url: '/operation/web/operationGroupDashboard/list',
    method: 'get',
    params
  })
}

// 获取集团驾驶舱配置详细信息
export function getDashboardConfigDetail(measurementPointId) {
  return request({
    url: `/operation/web/operationGroupDashboard/${measurementPointId}`,
    method: 'get'
  })
}

// 新增集团驾驶舱配置
export function addDashboardConfig(data) {
  return request({
    url: '/operation/web/operationGroupDashboard',
    method: 'post',
    data
  })
}

// 修改集团驾驶舱配置
export function updateDashboardConfig(data) {
  return request({
    url: '/operation/web/operationGroupDashboard',
    method: 'put',
    data
  })
}

// 删除集团驾驶舱配置
export function deleteDashboardConfig(measurementPointIds) {
  return request({
    url: `/operation/web/operationGroupDashboard/${measurementPointIds}`,
    method: 'delete'
  })
}